/**
 * Created by Administrator on 2016/8/17.
 */
var map =new ol.Map({
    target:'map',
    layers:[
        new ol.layer.Tile({
            source:new ol.source.OSM()
        })
    ],
    view:new ol.View({
        center:ol.proj.fromLonLat([110.41,32.82]),
        zoom:4
    })
});
    document.getElementById('zoom-out').onclick=function(){
        var view =map.getView();
        var zoom=view.getZoom();
        view.setZoom(zoom-1);
    }
    document.getElementById('zoom-in').onclick=function(){
        var view =map.getView();
        var zoom=view.getZoom();
        view.setZoom(zoom+1);
    }